//
//  ICMPersonerModel.m
//  ICrEAM
//
//  Created by Cty on 2016/11/06.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ICMPersonerModel.h"

@implementation ICMPersonerModel
+(instancetype)creatDummyData{
    ICMPersonerModel *model = [[ICMPersonerModel alloc]init];
    //block1
    model.ownerName = @"安迪";//车主姓名
    model.gender = @"男";//性别
    model.birthday = @"1991-02-19";//出生日期
    model.ownerType = @"个人";//车主性质
    model.cerType = @"身份证";//证件类型
    model.cerNum = @"310107199003257812";//证件号码
    
    //block2
    model.province = @"上海市";//所在省份
    model.city = @"上海市";//城市
    model.district = @"嘉定区";//区县
    model.phoneNum = @"13636315569";//手机号码
    model.address = @"真南路666号";//地址
    
    //block3
    model.adviserName = @"娇娇";//专业服务顾问
    model.vwOneHome = @"V20293817461";//大众一家会员
    model.oneHomeNum = @"V20293817461";//会员编号
    
    //block4
    model.profType = @"IT";//行业小类型
    model.familyIncome = @"3000000";//家庭月收入
    model.hobby = @"Dota";//爱好
    model.consumeProperty = @"理性型";//消费特征
    model.mannerProperty = @"质量型";//行为特征
    model.interestedPresent = @"食物";//喜欢的礼品
    model.interestedActivity = @"开荒";//感兴趣的活动
    //block5
    model.advancedReceived = @"200";//预收款
    model.amount = @"50000";//欠款金额
    
    
    return model;
}

+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper{
    return @{@"ownerName":@"OWNER_NAME",
             @"gender":@"GENDER",
             @"birthday":@"BIRTHDAY",
             @"ownerType":@"OWNER_PROPERTY",
             @"cerType":@"CT_CODE",
             @"cerNum":@"CERTIFICATE_NO",
             @"province":@"PROVINCE",
             @"city":@"CITY",
             @"district":@"DISTRICT",
             @"phoneNum":@"MOBILE",
             @"address":@"ADDRESS",//@"adviserName":@"DEDICATED_SERVICE_ADVISOR",
             @"profType":@"INDUSTRY_SECOND",
             @"familyIncome":@"FAMILY_INCOME",
             @"hobby":@"HOBBY",
             @"consumeProperty":@"CONSUMER_PROPERTY",
             @"mannerProperty":@"BEHAVIOR_PROPERTY",
             @"interestedPresent":@"ENJOY_GIFT",
             @"interestedActivity":@"INTEREST_ACTIVITIES",
             @"advancedReceived":@"PRE_PAY",
             @"amount":@"ARREARAGE_AMOUNT"
             };
}


- (void)setupPersonerModelWithOwnerInfoEditView:(ICMOwnerInfoEditView *)personerInfoView{
    
    //车主姓名
    self.ownerName = personerInfoView.ownerNameView.contentText;
    //性别
    NSString *owner_sex = [ICrEAMTool getDeatilCodeWithParameterDesc:personerInfoView.ownerSexView.contentText withCode:ICMEnumIntToString(ICMEnumGenderPre)];
    self.gender = owner_sex?owner_sex:@"0";
    //手机号码
    self.phoneNum = personerInfoView.ownerPhoneView.contentText;
    //所在省
    self.province = personerInfoView.ownerShengView.noStr;
    
    //出生日期
    self.birthday = personerInfoView.ownerBirthView.contentText;
    //车主性质
    NSString *ownerType = [ICrEAMTool getDeatilCodeWithParameterDesc:personerInfoView.ownerPropertyView.contentText withCode:ICMEnumIntToString(ICMEnumOwnerPropertyPre)];
    self.ownerType = ownerType?ownerType:@"0";
    //所在城市
    self.city = personerInfoView.ownerCityView.noStr;
    //所在县区
    self.district = personerInfoView.ownerTownView.noStr;
    
    //证件类型
    NSString *cerType = [ICrEAMTool getDeatilCodeWithParameterDesc:personerInfoView.ownerVerTypeView.contentText withCode:ICMEnumIntToString(ICMEnumCerTypePre)];
    self.cerType = cerType?cerType:@"0";
    //证件号码
    self.cerNum = personerInfoView.ownerVerNumView.contentText;
    //详细地址
    self.address = personerInfoView.ownerAddressView.contentText;
    
    //专属服务顾问
    //self.adviserCode = personerInfoView.ownerServerView.noStr;
    
    //行业小类
    NSString *profType = [ICrEAMTool getDeatilCodeWithParameterDesc:personerInfoView.ownerJobTypeView.contentText withCode:ICMEnumIntToString(ICMEnumProfTypePre)];
    self.profType = profType?profType:@"0";
    //月家庭收入
    NSString *familyIncome = [ICrEAMTool getDeatilCodeWithParameterDesc:personerInfoView.ownerMoneyView.contentText withCode:ICMEnumIntToString(ICMEnumFamilyIncomePre)];
    self.familyIncome = familyIncome?familyIncome:@"0";
    //爱好
    NSMutableString *hobby = [[NSMutableString alloc] init];
    NSString *hobbysStr = personerInfoView.ownerLikeView.contentText;
    NSArray *hobbysArray = [hobbysStr componentsSeparatedByString:@";"];
    if(hobbysStr && ![hobbysStr isEqualToString:@""] && hobbysArray && hobbysArray.count > 0)
    {
        for(NSString *str in hobbysArray)
        {
            NSString *temp = [ICrEAMTool getDeatilCodeWithParameterDesc:str withCode:ICMEnumIntToString(ICMEnumHobbyPre)];
            if(temp && ![temp isEqualToString:@""])
            {
                [hobby appendString:temp];
                [hobby appendString:@";"];
            }
        }
    }
    //self.hobby = hobby?hobby:@"0";
    self.hobby = personerInfoView.ownerLikeView.contentText?personerInfoView.ownerLikeView.contentText:@"";
    //消费特征
    NSString *consumeProperty = [ICrEAMTool getDeatilCodeWithParameterDesc:personerInfoView.ownerShopTypeView.contentText withCode:ICMEnumIntToString(ICMEnumConsumePropertyPre)];
    self.consumeProperty = consumeProperty?consumeProperty:@"0";
    
    //行为特征
    NSString *mannerProperty = [ICrEAMTool getDeatilCodeWithParameterDesc:personerInfoView.ownerDoTypeView.contentText withCode:ICMEnumIntToString(ICMEnumMannerPropertyPre)];
    self.mannerProperty = mannerProperty?mannerProperty:@"0";
    //喜欢的礼品
    self.interestedPresent = personerInfoView.ownerGitView.contentText;
    //感兴趣的活动
    self.interestedActivity = personerInfoView.ownerActView.contentText;
    

    
}


@end
